﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcApplicationBindersSample.Models.BindNeverModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	[BindNever]
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>[BindNever]</h2>
    <div>
        <% using (Html.BeginForm()) { %>
            <div>
                <fieldset>
                    <legend>Incoming model</legend>
                    <p>First name: <%: ViewData.Eval("FirstName") %></p>
                    <p>Last name: <%: ViewData.Eval("LastName") %></p>
                    <p>Age: <%: ViewData.Eval("Age") %></p>
                    <p>Salary: <%: ViewData.Eval("Salary") %></p>
                    <p class="note">
                        If the binder needs to instantiate a new model (e.g. as a parameter), the Salary property will be default(Decimal), which is 0.
                        If using UpdateModel() to update an existing model, the Salary property will maintain its original value.
                        In neither case will the Salary property be set to the user input value.
                    </p>
                </fieldset>
            </div>
            <div>
                <fieldset>
                    <legend>New input</legend>
                    <p>First name: <%: Html.TextBoxFor(m => m.FirstName) %> <%: Html.ValidationMessageFor(m => m.FirstName) %></p>
                    <p>Last name: <%: Html.TextBoxFor(m => m.LastName) %> <%: Html.ValidationMessageFor(m => m.LastName) %></p>
                    <p>Age: <%: Html.TextBoxFor(m => m.Age) %> <%: Html.ValidationMessageFor(m => m.Age) %></p>
                    <p>Salary: <%: Html.TextBoxFor(m => m.Salary) %> <%: Html.ValidationMessageFor(m => m.Salary) %></p>
                    <p><input type="submit" /></p>
                </fieldset>
            </div>
        <% } %>
    </div>
</asp:Content>
